const baseUrl = 'https://volunteer.daokeyun.com/api/';

const urls = {
  "login" : "wechat/mini/login", //登录
  "profile" : "v1/profile", //退出
  "register" : "v1/register", //注册
  "refresh" : "v1/refresh", // 刷新token
  'index' :'v1/mini/index',
  'news.activity'  : 'v1/mini/news/activity',
  'news'  : 'v1/mini/news',
  'activity': 'v1/mini/activity',
  'decrypt.user.info': 'wechat/mini/decrypt-user-info',
  'activity.apply': 'v1/mini/activity/apply', //活动报名

  'activity.apply.record': 'v1/mini/activity/apply/record', //活动报名

  'volunteer.list': 'v1/mini/volunteer/list',
  'volunteer.info': 'v1/mini/volunteer/info',//用户信息
  'volunteer.apply': 'v1/mini/volunteer/apply',//志愿者申请
  'volunteer.activity': 'v1/mini/volunteer/activity',//志愿者活动
  'volunteer.record': 'v1/mini/volunteer/record',
  'volunteer.record.review': 'v1/mini/volunteer/record/review',

  'volunteer.organizations': 'v1/mini/volunteer/organizations', 


}

function getUrl(name=null) {
  if(name) {
    return baseUrl+urls[name];
  }
  return baseUrl;
}

export default getUrl;